package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.teaching.dao.TeachingBooktitleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingBooktitleMapper;
import com.ruoyi.teaching.domain.TeachingBooktitle;
import com.ruoyi.teaching.service.ITeachingBooktitleService;

/**
 * 职称信息Service业务层处理
 * 
 * @author 孙嘉荣
 * @date 2022-03-21
 */
@Service
public class TeachingBooktitleServiceImpl implements ITeachingBooktitleService 
{
    @Autowired
    private TeachingBooktitleMapper teachingBooktitleMapper;
    @Autowired
    private TeachingBooktitleDao teachingBooktitleDao;

//    @Override
//    public TeachingBooktitle selectTeachingBooktitleList()
//    {
//        return teachingBooktitleMapper.selectTeachingBooktitleByBooktitleId(booktitleId);
//    }


    /**
     * 查询职称信息
     * 
     * @param booktitleId 职称信息主键
     * @return 职称信息
     */
    @Override
    public TeachingBooktitle selectTeachingBooktitleByBooktitleId(Long booktitleId)
    {
        return teachingBooktitleMapper.selectTeachingBooktitleByBooktitleId(booktitleId);
    }

    /**
     * 查询职称信息列表
     * 
     * @param teachingBooktitle 职称信息
     * @return 职称信息
     */
    @Override
    public List<TeachingBooktitle> selectTeachingBooktitleList(TeachingBooktitle teachingBooktitle)
    {
        return teachingBooktitleMapper.selectTeachingBooktitleList(teachingBooktitle);
    }

    /**
     * 新增职称信息
     * 
     * @param teachingBooktitle 职称信息
     * @return 结果
     */
    @Override
    public int insertTeachingBooktitle(TeachingBooktitle teachingBooktitle)
    {
        teachingBooktitle.setCreateTime(DateUtils.getNowDate());
        return teachingBooktitleMapper.insertTeachingBooktitle(teachingBooktitle);
    }

    /**
     * 修改职称信息
     * 
     * @param teachingBooktitle 职称信息
     * @return 结果
     */
    @Override
    public int updateTeachingBooktitle(TeachingBooktitle teachingBooktitle)
    {
        teachingBooktitle.setUpdateTime(DateUtils.getNowDate());
        return teachingBooktitleMapper.updateTeachingBooktitle(teachingBooktitle);
    }

    /**
     * 批量删除职称信息
     * 
     * @param booktitleIds 需要删除的职称信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingBooktitleByBooktitleIds(Long[] booktitleIds)
    {
        return teachingBooktitleMapper.deleteTeachingBooktitleByBooktitleIds(booktitleIds);
    }

    /**
     * 删除职称信息信息
     * 
     * @param booktitleId 职称信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingBooktitleByBooktitleId(Long booktitleId)
    {
        return teachingBooktitleMapper.deleteTeachingBooktitleByBooktitleId(booktitleId);
    }
}
